<mk-drawer-form
    v-model="drawer"
    :loading="drawerLoading"
    :title="typeof drawerData.id === 'undefined' ? '添加' : '编辑'"
    @save="saveDrawer()">
    <el-tabs type="card">
        <el-tab-pane label="基本信息">
            <el-form
                :model="drawerData"
                ref="drawerData" 
                :rules="drawerRules" 
                label-width="100px">
                <el-form-item label="封面：" prop="cover">
                    <mk-file-select v-model="drawerData.cover" :width="48" :height="32"></mk-file-select>
                    48*32是最佳像素
                </el-form-item>
                <el-form-item label="名称：" prop="title">
                    <el-input v-model="drawerData.title" placeholder="请输入语言名称，例：中文" maxlength="100" show-word-limit></el-input>
                </el-form-item>
                <el-form-item label="缩写：" prop="name">
                    <el-input 
                        v-model="drawerData.name" 
                        :disabled="drawerIndex !== ''"
                        placeholder="请输入语言缩写，例：cn" 
                        maxlength="100" 
                        show-word-limit>
                    </el-input>
                </el-form-item>
                <el-form-item label="默认：" prop="default">
                    <el-switch
                        v-model="drawerData.default"
                        active-color="#13ce66"
                        :active-value="1"
                        :inactive-value="0">
                    </el-switch>
                </el-form-item>
                <el-form-item label="状态：" prop="status">
                    <el-switch
                        v-model="drawerData.status"
                        active-color="#13ce66"
                        :active-value="1"
                        :inactive-value="0">
                    </el-switch>
                </el-form-item>
            </el-form>
        </el-tab-pane>
        <el-tab-pane label="语言参数">
            <mk-parameter v-model="drawerData.parameter"></mk-parameter>
        </el-tab-pane>
    </el-tabs>
</mk-drawer-form>